﻿#include "CKeyboardHookHelper.h"

int main()
{

    CKeyboardHookHelper::Instance().Initialize();


    KEY_DATA_SET keyList1;
    keyList1.insert(CKeyboardHookHelper::Instance().GetKeyDataByName(_T("lCtrl")));

    KEY_DATA_SET keyList2;
    keyList2.insert(CKeyboardHookHelper::Instance().GetKeyDataByName(_T("lCtrl")));

    KB_DATA kdActiveKey1 = CKeyboardHookHelper::Instance().GetKeyDataByName(_T("Q"));
    KB_DATA kdActiveKey2 = CKeyboardHookHelper::Instance().GetKeyDataByName(_T("P"));
    KB_DATA kdActiveKey3 = CKeyboardHookHelper::Instance().GetKeyDataByName(_T("M"));

    auto cbDown = [](const HOOK_KEY_INFO& Hki) {
        
        CKeyboardHookHelper::LogPrintf(_T("KeyDown\r\n"));
        
        };

    auto cbHold = [](const HOOK_KEY_INFO& Hki) {

        CKeyboardHookHelper::LogPrintf(_T("KeyHold  ID: %d time: %dms\r\n"), Hki.m_nTickDuration);

        };

    auto cbUp = [](const HOOK_KEY_INFO& Hki) {

        CKeyboardHookHelper::LogPrintf(_T("KeyUp ID: %d\r\n"));

        };

    CKeyboardHookHelper::Instance().AddShortcutKeys(keyList1, kdActiveKey1, cbDown, cbHold, cbUp);
    CKeyboardHookHelper::Instance().AddShortcutKeys(keyList2, kdActiveKey2, cbDown, cbHold, cbUp);
    CKeyboardHookHelper::Instance().AddShortcutKeys(keyList2, kdActiveKey3, cbDown, cbHold, cbUp);

    system("pause");

    CKeyboardHookHelper::Instance().Uninitialize();

    return 0;
}
